/***
 * @Description:
 * @Author: LI Yihong
 * @Email: liyh@jihua.ac.cn
 * @Date: 2024-10-22 15:22:00
 * @LastEditTime: 2024-10-22 15:22:00
 * @LastEditors: LI Yihong
 * @FilePath: \STM32F407_Board\applications\keyPress\keyPress.hpp
 */
#pragma once
#include <drivers/pin.h>
#include <memory>
#include <board.h>
#include <vector>
#include <string>
#include "cxx_thread.h"
#include "cxx_semaphore.h"
#include "cxx_mail.h"

using namespace rtthread;
using namespace std;

enum class KEY_STATE
{
    CLICK,
    IDLE,
    LONG_PRESS,
    DOUBLE_CLICK
};

class KeyPress : public Thread
{
public:
    using Thread::Thread;

    void run(void *parameter);

private:
    void keyInit();
    bool getKeyPress(rt_base_t key);

public:
    shared_ptr<Mail<vector<string>, 10>> cmdMail;
};
